<%-- 
    Document   : movieList
    Created on : May 1, 2013, 5:39:55 PM
    Author     : DevSteve
--%>

<%@page import="java.util.List"%>
<%@page import="java.io.FileReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.FileNotFoundException"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.File"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="db.DB"%>
<%@page import="db.MovieObj"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <title>Dataflix</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="content-language" content="en" />
        <meta name="description" content="" />
        <meta name="language" content="en" />
        <link type="text/css" rel="stylesheet" href="../css/style.css"/>
        <link type="text/css" rel="stylesheet" href="../css/style.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/jquery-ui-1.9.2.custom.min.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/timeline.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/bootstrap.min.css"/>
        <style type="text/css">
            body {
                padding-bottom: 40px;
            }
            .sidebar-nav {
                padding: 9px 0;
            }
        </style>
        <script src="../js/jquery-1.9.1.min.js"></script>
        <script src="../js/jquery-ui-1.9.2.custom.min.js"></script>
        <script src="../js/bootstrap.min.js"></script>
        <script>

        </script>

    <head>
    <body>

        <table id="head">
            <tr>
                <td>
                    <a href="manager.jsp"><img style="margin-left:10%;" src="../images/logoadmin.png"/></a>
                </td>

                <td>
                    <table id="loginbox">
                        <tr>
                            <td width="40%">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div class="bottom"></div>
        <div class="container-fluid">
            <h3>
                Edit Employee
            </h3>
            <form method="post" action="updateEmployee.jsp">
                <table class="table table-bordered" style="width:400px;">
                    <%
                        String id = request.getParameter("id");
                        int no = Integer.parseInt(id);
                        int sumcount = 0;
                        try {
                            DB data = new DB();
                            Connection conn = data.getConnection();
                            String query = "select * from Users where id='" + no + "'";
                            Statement st = conn.createStatement();
                            ResultSet rs = st.executeQuery(query);
                            while (rs.next()) {
                    %>
                    <tr>
                        <th>Id</th>
                        <td><%=rs.getString("Id")%></td>
                    </tr>
                    <tr>
                        <th>Email</th>
                        <td><input class="input-large"type="text" name="email" value="<%=rs.getString("Email")%>"></td>
                    </tr>
                    <tr>
                        <th>First Name</th>
                        <td><input class="input-large"type="text" name="firstName" value="<%=rs.getString("FirstName")%>"></td>
                    </tr>
                    <tr>
                        <th>Last Name</th>
                        <td><input class="input-large" type="text" name="lastName" value="<%=rs.getString("LastName")%>"></td>
                    </tr>
                    <tr>
                        <th>Address</th>
                        <td><input class="input-large"type="text" name="address" value="<%=rs.getString("Address")%>"></td>
                    </tr>
                    <tr>
                        <th>Zip Code</th>
                        <td><input class="input-large"type="text" name="zipCode" value="<%=rs.getString("ZipCode")%>"></td>
                    </tr>
                    <tr>
                        <th>SSN</th>
                        <td><input class="input-large"type="text" name="ssn" value="<%=rs.getString("SSN")%>"></td>
                    </tr>
                    <tr>
                        <th>Hourly Rate</th>
                        <td><input class="input-large"type="text" name="hourlyRate" value="<%=rs.getString("HourlyRate")%>"></td>
                    </tr>
                    <tr>
                        <th>Start Date</th>
                        <td ><input class="input-large" type="text" class=" input_area" name="startDate" value="<%=rs.getString("StartDate")%>"></td>
                    </tr>
                    <tr>
                        <th>Password</th>
                        <td ><input class="input-large" type="text" class=" input_area" name="password" value="<%=rs.getString("Password")%>"></td>
                    </tr>
                    <tr>
                        <td><input type="hidden" name="id" value="<%=rs.getString("Id")%>"></td>
                        <td style="text-align:right;"><input type="submit" name="Submit" value="Update" class="btn"></td>
                            
                    </tr>
                    <%
                            }
                        } catch (Exception e) {
                    }
                    %>
                </table>
            </form>
            <body>
                </html>



